package demo01;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

/**
 * @Description: 类作用描述
 * @Author: ChenZhiXiang
 * @CreateDate: 2019/5/8 0008 10:54
 * @Version: 1.0
 */
@Configuration
public class Demo01Config {

    @Bean
    public FunctionService functionService(){
        return new FunctionService();
    }

    @Bean
    public UseFunctionService useFunctionService(){
        UseFunctionService useFunctionService = new UseFunctionService();
        // set方法注入
        useFunctionService.setFunctionService(functionService());
        return useFunctionService;
    }
}
